package com.yuexun.dhdoctor.module.contractmanage.adapter;

import android.widget.AbsListView;
import android.widget.LinearLayout;
import android.widget.TextView;


import com.yuexun.dhdoctor.R;
import com.yuexun.dhdoctor.module.contractmanage.bean.ContractManageTestDetailBean;

import org.kymjs.kjframe.widget.AdapterHolder;
import org.kymjs.kjframe.widget.KJAdapter;

import java.util.Collection;

/**
 * Created by work-jx on 2016/10/27.
 */
public class ContractManageTestDetailAdapter extends KJAdapter<ContractManageTestDetailBean.RowsBean>{

    public ContractManageTestDetailAdapter(AbsListView view, Collection<ContractManageTestDetailBean.RowsBean> mDatas, int itemLayoutId) {
        super(view, mDatas, itemLayoutId);
    }

    @Override
    public void convert(AdapterHolder adapterHolder, ContractManageTestDetailBean.RowsBean contractManageTestDetailBean, boolean b) {
        TextView test_detail_adapter_status = (TextView)adapterHolder.getView(R.id.test_detail_adapter_status);
        LinearLayout test_detail_adapter_ll = (LinearLayout)adapterHolder.getView(R.id.test_detail_adapter_ll);
        adapterHolder.setText(R.id.test_detail_adapter_name,contractManageTestDetailBean.getItem_name());
        adapterHolder.setText(R.id.test_detail_adapter_current,contractManageTestDetailBean.getResult_value());
//        test_detail_adapter_status.setText(contractManageTestDetailBean.getNORMAL().replace("Z",""));
//        if(!contractManageTestDetailBean.getNORMAL().contains("Z"))
//        {
//            test_detail_adapter_ll.setBackgroundColor(mCxt.getResources().getColor(R.color.test_red));
//        }
//        else {
//            test_detail_adapter_ll.setBackgroundColor(mCxt.getResources().getColor(R.color.white));
//        }
        adapterHolder.setText(R.id.test_detail_adapter_standard,"参考范围:"+contractManageTestDetailBean.getNorm_limit());
    }
}
